feat(challenges): load docker challenges and move bounty out - #312
Merged
Merged
Conversation
The master now runs any challenge that implements docs/CHALLENGES.md as a Docker container: it reads authenticated get_weights once per epoch, signs exact leaves, seals, and proxies public routes under /challenge/<id>/. The new challenge-supervisor is the only process with the Docker socket. It pulls stable/edge/pinned GHCR images, checks labels and GitHub build provenance, canaries without secrets, and rolls back. Trust root version >= 3 enables algorithm 3: 1..64 challenges, each paying share * min(sum(leaves), 10^12) / 10^12, with the rest burned. Validators keep verifying signed leaves only. Bounty under algorithm 3 with full_share_mass = 10 pays exactly the algorithm 2 amount. The in-process bounty service is removed; it now lives in CortexLM/bounty. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Greptile (@greptileai) review |
This comment has been minimized.
This comment has been minimized.
- Rollout now stops the running container and keeps it aside. It removes that container only after the replacement answers /version. A failed create, start or readiness check restarts the previous container unchanged. - Each container carries a fingerprint of its full spec. A registry change (env, resources, limits) now redeploys even when the digest stays the same. - An algorithm 2 answer with any weight that is not a u64 integer is rejected as a whole, so the challenge burns instead of partly paying. - Algorithm 1 signed Bounty's legacy champion lattice, which containers never compute, so container challenges burn under it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
All four findings, including the outside-diff list, are addressed in fe08ade. I answered each one inline:
Verification: 1079 tests pass, and ruff, mypy, Greptile (@greptileai) review |
- A supervisor restart after it set the serving container aside no longer deletes that backup. The next reconcile first restores it. - Labels and build provenance are re-checked against the current registry entry for every new container spec. A source edit with the same digest can no longer deploy an image that was never verified against that source. Only the canary is skipped for configuration-only changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Both new findings are fixed in 0f80ec9, and I replied and resolved each thread inline:
1081 tests pass. Greptile (@greptileai) review |
A GitHub 403/429/5xx or network error on the attestation lookup is now a TransientError. The next poll retries it. Only a definitive answer (no provenance, bad labels, failed canary or rollout) is remembered as a refusal of that configuration. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Fixed in b59a14f: attestation outages (403, 429, 5xx or network errors) are now transient and retried on the next poll. Only definitive verdicts are remembered as refusals. The thread is resolved, and 1083 tests pass. Greptile (@greptileai) review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Before this change, every challenge lived inside the master process, and adding one meant changing Cortex code. Bounty was one of those in-process challenges.
New behavior
docs/CHALLENGES.mdas a Docker container, and keeps it up to date:deploy/challenges/registry.toml, decides what runs.GET /internal/v1/get_weights?epoch=, signs exact leaves for the sealed participant set, and seals./challenge/<id>/.internal/paths, dot segments,%and\are refused; only 3 headers are forwarded; bodies are capped.GET /v1/metagraph/latestgives containers the sealed hotkey→uid map.cortex challenge-supervisor. It is the only service with the Docker socket, and it reads no secret. It:stable,edgeor a pinned digest from GHCR;/data;version >= 3):share * min(sum(leaves), 10^12) / 10^12, and the shortfall burns to UID0;full_share_mass = 10pays exactly what algorithm 2 pays; the E2E test checks this.ghcr.io/cortexlm/bounty:stableand attested;bounty.sqlite3and the session key.src/cortex/bounty,docs/BOUNTY.mdand theBOUNTY_*master settings.Validation
leaf_scoresand proxy refusals.scripts/check_repo.py --finalcheck_deploynow allows exactly one Docker-socket service (the supervisor, which mounts nothing else) and requires the gateway to mount the registry and joincortex-challenges.CapDrop ALL,no-new-privileges, UID 65532 and no host port./versionreturned contract 1;get_weightsreturned 401 for a wrong bearer and 503 fail-closed with no feed configured.Public contract
external-miner/bounty.mdpoints to CortexLM/bounty, and the validator guide covers algorithm 3.BASE_*/domain compatibility remain intact.Greptile
@greptileai reviewRisk
version >= 3document. The committed trust root is still the legacy one.docs/operator.md. Until then the Bounty share burns; it is never reassigned.ponytail:). Provenance is an existence check through the GitHub attestations API, not a Sigstore signature verification. The upgrade path is documented.BOUNTY_*env. The Bounty database is copied, not moved.🤖 Generated with Claude Code
No outstanding finding blocks merging.
Summary
The PR moves Bounty into a challenge container and adds container supervision, proxying, and owner-activated algorithm 3. Temporary GitHub attestation failures now retry on a later poll instead of permanently refusing an update. No new actionable issue was identified.
Reviews (4) · Last reviewed commit: "fix(challenges): retry attestation outag..."